package com.sweetguy.dto;

import com.sweetguy.constant.RE;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Schema(name = "用户添加DTO")
@Data
public class UserInsertDTO implements Serializable, RE {

    @Schema(description = "登陆账号")
    @NotEmpty(message = "登录账号不能为空")
    @Pattern(regexp = USERNAME_RE, message = USERNAME_RE_MSG)
    private String username;

    @Schema(description = "登陆密码")
    @Pattern(regexp = PASSWORD_RE, message = PASSWORD_RE_MSG)
    private String password;

    @Schema(description = "真实姓名")
    @NotEmpty(message = "真实姓名不能为空")
    @Pattern(regexp = REALNAME_RE, message = REALNAME_RE_MSG)
    private String realname;

    @Schema(description = "身份证号")
    @NotEmpty(message = "身份证号不能为空")
    @Pattern(regexp = ID_CARD_RE, message = ID_CARD_RE_MSG)
    private String idcard;

    @Schema(description = "手机号码")
    @NotEmpty(message = "手机号码不能为空")
    @Pattern(regexp = PHONE_RE, message = PHONE_RE_MSG)
    private String phone;

    @Schema(description = "电子邮箱")
    @NotEmpty(message = "电子邮箱不能为空")
    @Pattern(regexp = EMAIL_RE, message = EMAIL_RE_MSG)
    private String email;

    @Schema(description = "描述")
    @NotEmpty(message = "描述不能为空")
    @Pattern(regexp = INFO_RE, message = INFO_RE_MSG)
    private String info;
}
